﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using StateGrid.MDBservice;

namespace StateGrid.ZHBK
{
    /// <summary>
    /// Summary description for ZHBK_PM
    /// </summary>
    public class ZHBK_PM : PM
    {
        /// <summary>
        /// 分类编码
        /// </summary>
        public String flbm
        {
            get;
            set;
        }
        /// <summary>
        /// 索引编码
        /// </summary>
        public String sybm
        {
            get;
            set;
        }
        /// <summary>
        /// 文件名
        /// </summary>
        public String wjm
        {
            get;
            set;
        }
        /// <summary>
        /// 原文件名
        /// </summary>
        public String ywjm
        {
            get;
            set;
        }
        /// <summary>
        /// 标题
        /// </summary>
        public String bt
        {
            get;
            set;
        }
        /// <summary>
        /// 作者
        /// </summary>
        public String zz
        {
            get;
            set;
        }
        /// <summary>
        /// 日期
        /// </summary>
        public DateTime rq
        {
            get;
            set;
        }
        /// <summary>
        /// 编号
        /// </summary>
        public String bh
        {
            get;
            set;
        }

        /// <summary>
        /// 年份
        /// </summary>
        public int nf
        {
            get;
            set;
        }
        /// <summary>
        /// 月份
        /// </summary>
        public int yf
        {
            get;
            set;
        }
        /// <summary>
        /// 栏目
        /// </summary>
        public String lm
        {
            get;
            set;
        }
        /// <summary>
        /// 全文
        /// </summary>
        public String qw
        {
            get;
            set;
        }
        /// <summary>
        /// 更新日期
        /// </summary>
        public DateTime gxrq
        {
            get;
            set;
        }
        /// <summary>
        /// 登录人
        /// </summary>
        public String dlr
        {
            get;
            set;
        }
        public ZHBK_PM()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        public override string ToString()
        {
            String ret;
            ret = "[索引编码]" + this.sybm + "[标题]" + this.bt + " [年份]" + this.nf;
            return ret;
        }

        public override string AllContent()
        {
            String ret = "('" + flbm + "','" + sybm + "','" + wjm + "','" + bt + "','" + zz + "','" + nf + "','" + yf + "','" + rq + "','" + bh + "','" + lm + "','" + qw + "','" + ywjm + "','" + gxrq + "','" + dlr + "')";
            return ret;
        }

        public override void fillEmptyStringAsNull()
        {
            String temp = "NULL";
            if (String.Empty.Equals(this.flbm)) flbm = temp;
            if (String.Empty.Equals(this.sybm)) sybm = temp;
            if (String.Empty.Equals(this.wjm)) wjm = temp;
            if (String.Empty.Equals(this.ywjm)) ywjm = temp;
            if (String.Empty.Equals(this.bt)) bt = temp;
            if (String.Empty.Equals(this.zz)) zz = temp;
            if (String.Empty.Equals(this.bh)) bh = temp;
            if (String.Empty.Equals(this.lm)) lm = temp;
            if (String.Empty.Equals(this.qw)) qw = temp;
        }

        public override void eraseNullInEmptyString()
        {
            String temp = "NULL";
            if (temp.Equals(this.flbm)) flbm = String.Empty;
            if (temp.Equals(this.sybm)) sybm = String.Empty;
            if (temp.Equals(this.wjm)) wjm = String.Empty;
            if (temp.Equals(this.ywjm)) ywjm = String.Empty;
            if (temp.Equals(this.bt)) bt = String.Empty;
            if (temp.Equals(this.zz)) zz = String.Empty;
            if (temp.Equals(this.bh)) bh = String.Empty;
            if (temp.Equals(this.lm)) lm = String.Empty;
            if (temp.Equals(this.qw)) qw = String.Empty;
        }
    }
}